<table class="table table-border table-bordered table-hover table-bg">
	<thead>
		<tr class="text-c">
			<th width="25"><input type="checkbox" value="" name=""></th>
			<th>客人姓名</th>
			<th>联系方式</th>
			<th>身份证</th>
			<th>预定房型</th>
			<th>预定定金</th>
			<th>支付方式</th>
			<th>状态</th>
			<th>预定时间</th>
		</tr>
	</thead>
	<tbody>
		<?php if(is_array($userlist) && count($userlist)){ ?>
		<?php foreach($userlist as $k=>$user){ ?>
		<tr class="text-c">
			<td><input type="checkbox" value="{$user['member_id']}" name=""></td>
			<td>{$user['nickname']}</td>
			<td>{$user['phone']}</td>
			<td>{$user['card']}</td>
			<td>{$user['room_type']}</td>
			<td>{$user['point']}</td>
			<td>{$user['paymethod']}</td>
			<td>
				<span class="select-box radius" style="width: 80px;">
					<select class="select ovisible" orderid="{$user['orderid']}">
						<option value="0" {$user['visible'] == 0 ? 'selected' : ''}>排队中</option>
						<option value="1" {$user['visible'] == 1 ? 'selected' : ''}>已转租</option>
						<option value="2" {$user['visible'] == 2 ? 'selected' : ''}>弃定金</option>
						<option value="3" {$user['visible'] == 3 ? 'selected' : ''}>退定金</option>
					</select>
				</span>
			</td>
			<td>{$user['createtime']|date="Y-m-d H:i",###}</td>
		</tr>
		<?php } }else{ ?>
		<tr class="text-c">
			<td colspan="19" >暂无数据...</td>
		</tr>
		<?php } ?>
	</tbody>
</table>
<!--page-->
<include file="Common/page" />
<script>
	$(document).ready(function(){
		$(".ovisible").on('change', function(){
			var obj = $(this);
				visible = obj.val();
				orderid = obj.attr('orderid');
			var load = layer.load(2);

			$.post("editvisible.html",{orderid: orderid, visible: visible}, function(data){
				layer.close(load);
				if(data/1 == 1){
					layer.msg('设置成功', {icon:1, time: 2000});
				}else{
					layer.msg('设置失败', {icon:2, time: 2000});
				}
			});
		});

		/*全选*/
		$("table thead th input:checkbox").on("click" , function(){
			$(this).closest("table").find("tr > td:first-child input:checkbox")
					.prop("checked",$("table thead th input:checkbox")
					.prop("checked"));
	    });
		
	});
</script>